//
//	MVMvlist.m
//
//	Create by mafeng on 13/8/2016
//	Copyright © 2016. All rights reserved.
//	Model file generated using JSONExport: https://github.com/Ahmed-Ali/JSONExport



#import "MVMvlist.h"

NSString *const kMVMvlistListennum = @"listennum";
NSString *const kMVMvlistMvId = @"mv_id";
NSString *const kMVMvlistMvdesc = @"mvdesc";
NSString *const kMVMvlistMvscore = @"mvscore";
NSString *const kMVMvlistMvtitle = @"mvtitle";
NSString *const kMVMvlistPicurl = @"picurl";
NSString *const kMVMvlistPubDate = @"pub_date";
NSString *const kMVMvlistPublictime = @"publictime";
NSString *const kMVMvlistSingerId = @"singer_id";
NSString *const kMVMvlistSingerMid = @"singer_mid";
NSString *const kMVMvlistSingerName = @"singer_name";
NSString *const kMVMvlistSingerid = @"singerid";
NSString *const kMVMvlistSingermid = @"singermid";
NSString *const kMVMvlistSingername = @"singername";
NSString *const kMVMvlistSingers = @"singers";
NSString *const kMVMvlistVid = @"vid";

@interface MVMvlist ()
@end
@implementation MVMvlist




/**
 * Instantiate the instance using the passed dictionary values to set the properties values
 */

-(instancetype)initWithDictionary:(NSDictionary *)dictionary
{
	self = [super init];
	if(![dictionary[kMVMvlistListennum] isKindOfClass:[NSNull class]]){
		self.listennum = dictionary[kMVMvlistListennum];
	}

	if(![dictionary[kMVMvlistMvId] isKindOfClass:[NSNull class]]){
		self.mvId = dictionary[kMVMvlistMvId];
	}

	if(![dictionary[kMVMvlistMvdesc] isKindOfClass:[NSNull class]]){
		self.mvdesc = dictionary[kMVMvlistMvdesc];
	}	
	if(![dictionary[kMVMvlistMvscore] isKindOfClass:[NSNull class]]){
		self.mvscore = dictionary[kMVMvlistMvscore];
	}

	if(![dictionary[kMVMvlistMvtitle] isKindOfClass:[NSNull class]]){
		self.mvtitle = dictionary[kMVMvlistMvtitle];
	}	
	if(![dictionary[kMVMvlistPicurl] isKindOfClass:[NSNull class]]){
		self.picurl = dictionary[kMVMvlistPicurl];
	}	
	if(![dictionary[kMVMvlistPubDate] isKindOfClass:[NSNull class]]){
		self.pubDate = dictionary[kMVMvlistPubDate];
	}	
	if(![dictionary[kMVMvlistPublictime] isKindOfClass:[NSNull class]]){
		self.publictime = dictionary[kMVMvlistPublictime];
	}	
	if(![dictionary[kMVMvlistSingerId] isKindOfClass:[NSNull class]]){
		self.singerId = dictionary[kMVMvlistSingerId];
	}

	if(![dictionary[kMVMvlistSingerMid] isKindOfClass:[NSNull class]]){
		self.singerMid = dictionary[kMVMvlistSingerMid];
	}	
	if(![dictionary[kMVMvlistSingerName] isKindOfClass:[NSNull class]]){
		self.singerName = dictionary[kMVMvlistSingerName];
	}	
	if(![dictionary[kMVMvlistSingerid] isKindOfClass:[NSNull class]]){
		self.singerid = dictionary[kMVMvlistSingerid];
	}

	if(![dictionary[kMVMvlistSingermid] isKindOfClass:[NSNull class]]){
		self.singermid = dictionary[kMVMvlistSingermid];
	}	
	if(![dictionary[kMVMvlistSingername] isKindOfClass:[NSNull class]]){
		self.singername = dictionary[kMVMvlistSingername];
	}	
	if(dictionary[kMVMvlistSingers] != nil && [dictionary[kMVMvlistSingers] isKindOfClass:[NSArray class]]){
		NSArray * singersDictionaries = dictionary[kMVMvlistSingers];
		NSMutableArray * singersItems = [NSMutableArray array];
		for(NSDictionary * singersDictionary in singersDictionaries){
			MVSinger * singersItem = [[MVSinger alloc] initWithDictionary:singersDictionary];
			[singersItems addObject:singersItem];
		}
		self.singers = singersItems;
	}
	if(![dictionary[kMVMvlistVid] isKindOfClass:[NSNull class]]){
		self.vid = dictionary[kMVMvlistVid];
	}	
	return self;
}


/**
 * Returns all the available property values in the form of NSDictionary object where the key is the approperiate json key and the value is the value of the corresponding property
 */
-(NSDictionary *)toDictionary
{
	NSMutableDictionary * dictionary = [NSMutableDictionary dictionary];
	dictionary[kMVMvlistListennum] = self.listennum;
	dictionary[kMVMvlistMvId] = self.mvId;
	if(self.mvdesc != nil){
		dictionary[kMVMvlistMvdesc] = self.mvdesc;
	}
	dictionary[kMVMvlistMvscore] = self.mvscore;
	if(self.mvtitle != nil){
		dictionary[kMVMvlistMvtitle] = self.mvtitle;
	}
	if(self.picurl != nil){
		dictionary[kMVMvlistPicurl] = self.picurl;
	}
	if(self.pubDate != nil){
		dictionary[kMVMvlistPubDate] = self.pubDate;
	}
	if(self.publictime != nil){
		dictionary[kMVMvlistPublictime] = self.publictime;
	}
	dictionary[kMVMvlistSingerId] = self.singerId;
	if(self.singerMid != nil){
		dictionary[kMVMvlistSingerMid] = self.singerMid;
	}
	if(self.singerName != nil){
		dictionary[kMVMvlistSingerName] = self.singerName;
	}
	dictionary[kMVMvlistSingerid] = self.singerid;
	if(self.singermid != nil){
		dictionary[kMVMvlistSingermid] = self.singermid;
	}
	if(self.singername != nil){
		dictionary[kMVMvlistSingername] = self.singername;
	}
	if(self.singers != nil){
		NSMutableArray * dictionaryElements = [NSMutableArray array];
		for(MVSinger * singersElement in self.singers){
			[dictionaryElements addObject:[singersElement toDictionary]];
		}
		dictionary[kMVMvlistSingers] = dictionaryElements;
	}
	if(self.vid != nil){
		dictionary[kMVMvlistVid] = self.vid;
	}
	return dictionary;

}

/**
 * Implementation of NSCoding encoding method
 */
/**
 * Returns all the available property values in the form of NSDictionary object where the key is the approperiate json key and the value is the value of the corresponding property
 */
- (void)encodeWithCoder:(NSCoder *)aCoder
{
	[aCoder encodeObject:self.listennum forKey:kMVMvlistListennum];	[aCoder encodeObject:self.mvId forKey:kMVMvlistMvId];	if(self.mvdesc != nil){
		[aCoder encodeObject:self.mvdesc forKey:kMVMvlistMvdesc];
	}
	[aCoder encodeObject:self.mvscore forKey:kMVMvlistMvscore];	if(self.mvtitle != nil){
		[aCoder encodeObject:self.mvtitle forKey:kMVMvlistMvtitle];
	}
	if(self.picurl != nil){
		[aCoder encodeObject:self.picurl forKey:kMVMvlistPicurl];
	}
	if(self.pubDate != nil){
		[aCoder encodeObject:self.pubDate forKey:kMVMvlistPubDate];
	}
	if(self.publictime != nil){
		[aCoder encodeObject:self.publictime forKey:kMVMvlistPublictime];
	}
	[aCoder encodeObject:self.singerId forKey:kMVMvlistSingerId];	if(self.singerMid != nil){
		[aCoder encodeObject:self.singerMid forKey:kMVMvlistSingerMid];
	}
	if(self.singerName != nil){
		[aCoder encodeObject:self.singerName forKey:kMVMvlistSingerName];
	}
	[aCoder encodeObject:self.singerid forKey:kMVMvlistSingerid];	if(self.singermid != nil){
		[aCoder encodeObject:self.singermid forKey:kMVMvlistSingermid];
	}
	if(self.singername != nil){
		[aCoder encodeObject:self.singername forKey:kMVMvlistSingername];
	}
	if(self.singers != nil){
		[aCoder encodeObject:self.singers forKey:kMVMvlistSingers];
	}
	if(self.vid != nil){
		[aCoder encodeObject:self.vid forKey:kMVMvlistVid];
	}

}

/**
 * Implementation of NSCoding initWithCoder: method
 */
- (instancetype)initWithCoder:(NSCoder *)aDecoder
{
	self = [super init];
	self.listennum = [aDecoder decodeObjectForKey:kMVMvlistListennum];
	self.mvId = [aDecoder decodeObjectForKey:kMVMvlistMvId];
	self.mvdesc = [aDecoder decodeObjectForKey:kMVMvlistMvdesc];
	self.mvscore = [aDecoder decodeObjectForKey:kMVMvlistMvscore];
	self.mvtitle = [aDecoder decodeObjectForKey:kMVMvlistMvtitle];
	self.picurl = [aDecoder decodeObjectForKey:kMVMvlistPicurl];
	self.pubDate = [aDecoder decodeObjectForKey:kMVMvlistPubDate];
	self.publictime = [aDecoder decodeObjectForKey:kMVMvlistPublictime];
	self.singerId = [aDecoder decodeObjectForKey:kMVMvlistSingerId];
	self.singerMid = [aDecoder decodeObjectForKey:kMVMvlistSingerMid];
	self.singerName = [aDecoder decodeObjectForKey:kMVMvlistSingerName];
	self.singerid = [aDecoder decodeObjectForKey:kMVMvlistSingerid];
	self.singermid = [aDecoder decodeObjectForKey:kMVMvlistSingermid];
	self.singername = [aDecoder decodeObjectForKey:kMVMvlistSingername];
	self.singers = [aDecoder decodeObjectForKey:kMVMvlistSingers];
	self.vid = [aDecoder decodeObjectForKey:kMVMvlistVid];
	return self;

}

/**
 * Implementation of NSCopying copyWithZone: method
 */
- (instancetype)copyWithZone:(NSZone *)zone
{
	MVMvlist *copy = [MVMvlist new];

	copy.listennum = self.listennum;
	copy.mvId = self.mvId;
	copy.mvdesc = [self.mvdesc copyWithZone:zone];
	copy.mvscore = self.mvscore;
	copy.mvtitle = [self.mvtitle copyWithZone:zone];
	copy.picurl = [self.picurl copyWithZone:zone];
	copy.pubDate = [self.pubDate copyWithZone:zone];
	copy.publictime = [self.publictime copyWithZone:zone];
	copy.singerId = self.singerId;
	copy.singerMid = [self.singerMid copyWithZone:zone];
	copy.singerName = [self.singerName copyWithZone:zone];
	copy.singerid = self.singerid;
	copy.singermid = [self.singermid copyWithZone:zone];
	copy.singername = [self.singername copyWithZone:zone];
	copy.singers = [self.singers copyWithZone:zone];
	copy.vid = [self.vid copyWithZone:zone];

	return copy;
}
@end
